<% 
	if (session.getAttribute("admin") == null) {
		response.sendRedirect("/kaola/admin/login.jsp");
	}
%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'add_category.jsp' starting page</title>
</head>

<body>
	<s:property value="errors['category.name'][0]" />
	<a href="/kaola/admin/manage.jsp">管理者主页</a>
	<form action="/kaola/categories/level2create" method="post">
		<table>
			<tr>
				<td>name:</td>
				<td><input type="text" name="category.name" /></td>
			</tr>
			<tr>
				<td>grade:</td>
				<td><input type="number" value="2" min="2" max="2" readonly="readonly" name="category.grade" /></td>
			</tr>
			<tr>
				<td>level1 category</td>
				<td>
					<s:select list="categories" listKey="id" listValue="name" name="category.category.id"></s:select>
				</td>
			</tr>
			<tr>
				<td colspan="2"><button type="submit">add category</button></td>
			</tr>
		</table>
	</form>
</body>
</html>
